class Valleyers::Show::LogosController < ApplicationController
  caches_page :show
  layout 'base.html', :only => [:new,:create]
  
  def new
    @logo = ValleyerLogo.new
  end

  def create
    begin
      @logo = ValleyerLogo.new(params[:valleyer_logo])
      @logo.valleyer = current_valleyer
      @logo.save ? redirect_to(valleyer_url(current_valleyer)) : render(:new)
    rescue
      logger.warn '图片上传失败'
    end
  end

  def show
    @logo = ValleyerLogo.find(params[:id])
  end

  def authorize

  end
end
